/*
							Copyright (C) 2010  Alourien Team
									
						This file is part of the Alourien Engine.

    The Alourien Engine is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    The Alourien Engine is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with the Alourien Engine.  If not, see <http://www.gnu.org/licenses/>.
	
 *File Name: MatrixMath.h
 *Programmer Name:Jose Castellano
 *Date of last update:10/27/2010
 *
 *Purpose:This Program is to create and Manipulate all the Matrices 
 * that are needed for all the work that is used involving 
 * the matrix and rendering.
 *
 *Basic Info: This file includes the basic functions along with the
 * rotation, scaling and translation vectors. It also has a function
 * that concatenates them inorder to make it a single matrix
 *
 *UPDATES:
 *1)Created the Program and documentation.
 *  Date:10/18/2010 Updater: Jose Castellano
 *
 *2)Added the matrix concatenation for more than just three matrices
 *  Date:10/19/2010 Updater: Jose Castellano
 *
 *3)Fixed the defined constants
 *  Date: 10/27/2010 Updater: Manuel Cuellar
 *
 */
 
#ifndef _MATRIXMATH_H
#define _MATRIXMATH_H 1

#include "Matrix2D.h"
#include "Matrix3D.h"
#include "MathClass.h"

//Pi
#define PI 3.14159265

#define toRad (PI/180)
#define toDeg (180/PI)

namespace Alourien
{
	class MatrixMath
	{
		public:
		MathClass obj;
		
		MatrixMath(void);
		~MatrixMath(void);
		
		//Creates the rotational matrix for a 2D matrix
		//Returns a 2D Matrix		
		Matrix2D MakeRotational(float angleInDeg);
		
		//Creates the rotationalXY matrix for a 3D matrix
		//Returns a 3D Matrix
		Matrix3D MakeRotationalXY(float angleInDeg);
		
		//Creates the rotationalXZ matrix for a 3D matrix
		//Returns a 3D Matrix
		Matrix3D MakeRotationalXZ(float angleInDeg);
		
		//Creates the rotationalYZ matrix for a 3D matrix
		//Returns a 3D Matrix
		Matrix3D MakeRotationalYZ(float angleInDeg);
		
		//Creates the scaling matrix for a 2D matrix
		//Returns a 2D Matrix
		Matrix2D MakeScaling(float xScaling, float yScaling);
		
		//Creates the scaling matrix for a 3D matrix
		//Returns a 3D Matrix
		Matrix3D MakeScaling(float xScaling, float yScaling, float zScaling);
		
		//Creates the translation matrix for a 2D matrix
		//Returns a 2D Matrix
		Matrix2D MakeTranslation(float x, float y);
		
		//Creates the translation matrix for a 3D matrix
		//Returns a 3D Matrix
		Matrix3D MakeTranslation(float x, float y, float z);
		
		//Creates the matrix that concatinates all the transformations for a 2D matrix
		//Returns a 2D Matrix
		Matrix2D CreateConcatinated(Matrix2D matScale, Matrix2D matRot, \
									Matrix2D matTrans);
									
		//Creates the matrix that concatinates all the transformations for a 3D matrix
		//Returns a 3D Matrix
		Matrix3D CreateConcatinated(Matrix3D matScale, Matrix3D matRot, \
									Matrix3D matTrans);
									
		//Creates the matrix that concatinates all the transformations for a 3D matrix
		//Returns a 3D Matrix
		Matrix3D CreateConcatinated(Matrix3D matScale, Matrix3D matRot, \
									Matrix3D matRot2,	Matrix3D matTrans);
									
		//Creates the matrix that concatinates all the transformations for a 3D matrix
		//Returns a 3D Matrix
		Matrix3D CreateConcatinated(Matrix3D matScale, Matrix3D matRot, \
						Matrix3D matRot2,Matrix3D matRot3,	Matrix3D matTrans);
	};
};

#endif